package domain;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

public class ContractModel {
    private Integer id;

    private Integer typeId;

    private String modelCode;

    private String name;

    private Integer effective;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date enterTime;

    private String location;

    private String fromSource;

    public ContractModel(Integer id, Integer typeId, String modelCode, String name, Integer effective, Date enterTime, String location, String fromSource) {
        this.id = id;
        this.typeId = typeId;
        this.modelCode = modelCode;
        this.name = name;
        this.effective = effective;
        this.enterTime = enterTime;
        this.location = location;
        this.fromSource = fromSource;
    }
    public ContractModel(Integer typeId, String modelCode, String name, Integer effective, Date enterTime, String location, String fromSource) {
        this.id = id;
        this.typeId = typeId;
        this.modelCode = modelCode;
        this.name = name;
        this.effective = effective;
        this.enterTime = enterTime;
        this.location = location;
        this.fromSource = fromSource;
    }

    public ContractModel() {
        super();
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getTypeId() {
        return typeId;
    }

    public void setTypeId(Integer typeId) {
        this.typeId = typeId;
    }

    public String getModelCode() {
        return modelCode;
    }

    public void setModelCode(String modelCode) {
        this.modelCode = modelCode == null ? null : modelCode.trim();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public Integer getEffective() {
        return effective;
    }

    public void setEffective(Integer effective) {
        this.effective = effective;
    }

    public Date getEnterTime() {
        return enterTime;
    }

    public void setEnterTime(Date enterTime) {
        this.enterTime = enterTime;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location == null ? null : location.trim();
    }

    public String getFromSource() {
        return fromSource;
    }

    public void setFromSource(String fromSource) {
        this.fromSource = fromSource == null ? null : fromSource.trim();
    }

    @Override
    public String toString() {
        return "ContractModel{" +
                "id=" + id +
                ", typeId=" + typeId +
                ", modelCode='" + modelCode + '\'' +
                ", name='" + name + '\'' +
                ", effective=" + effective +
                ", enterTime=" + enterTime +
                ", location='" + location + '\'' +
                ", fromSource='" + fromSource + '\'' +
                '}';
    }
}